package org.pim.smart.viewer.provider;

import org.eclipse.jface.viewers.ITableColorProvider;
import org.eclipse.jface.viewers.ITableFontProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.pim.smart.hibernate.domain.ContactMain;
import org.pim.smart.hibernate.domain.GroupContact;

public class ContactBookTreeViewerLabelProvider extends LabelProvider implements
		ITableLabelProvider, ITableColorProvider, ITableFontProvider {

	@Override
	public Image getColumnImage(Object element, int columnIndex) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getColumnText(Object element, int columnIndex) {
		// TODO Auto-generated method stub
		if (element instanceof GroupContact){
			GroupContact group = (GroupContact)element;
			switch (columnIndex){
			case 0: return group.getGroupName();
			default: return "";
			}
		} else if (element instanceof ContactMain){
			ContactMain contact = (ContactMain)element;
			switch (columnIndex){
			case 0: return contact.getContactName();
			case 1: return contact.getContactCompany();
			case 2: return contact.getContactBirth().toString();
			default: return "";
			}
		} else {
			return "";
		}
	}

	@Override
	public Color getBackground(Object element, int columnIndex) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Color getForeground(Object element, int columnIndex) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Font getFont(Object element, int columnIndex) {
		// TODO Auto-generated method stub
		return null;
	}

}
